﻿using System;
using System.Collections.Generic;

using System.Text;
using imeem.library;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.IO;
using System.Xml;

namespace imeem.api
{
    [XmlRoot("result")]
    public class imeemResult
    {
        private int _statusCode;
        private string _statusDescription;
        private string _statusDetail;
        private List<Item> _items;

        [XmlIgnore]
        public List<Item> Items
        {
            get { return _items; }
            set { _items = value; }
        }

        [XmlElement("items")]
        public ItemsSerializer ItemsSerializer
        {
            get 
            {
                if (_items == null)
                {
                    return null;
                }
                else
                {
                    return new ItemsSerializer(_items);
                }
            }
            set
            {
                _items = value.Items;
            }
        }

        [XmlElement("statusCode")]
        public int StatusCode
        {
            get { return _statusCode; }
            set { _statusCode = value; }
        }

        [XmlElement("statusDescription")]
        public string StatusDescription
        {
            get { return _statusDescription; }
            set { _statusDescription = value; }
        }

        [XmlElement("statusDetails")]
        public string StatusDetail
        {
            get { return _statusDetail; }
            set { _statusDetail = value; }
        }
    }
}
